package com.edu.jiangzhi.service;

import com.edu.jiangzhi.domain.Animal;

/**
 * @author duweiping
 */
public abstract class AnimalIntoIceboxService {
    private IceboxService iceboxService = new IceboxService();

    public void putIntoIcebox(Animal animal) {
        iceboxService.open();
        this.innerIceboxService(animal);
        iceboxService.close();
    }

    /**
     * 不同动物放入冰箱的方式
     * @param animal
     */
    protected abstract void innerIceboxService(Animal animal);
}
